/**
* This file is part of OntoApplications (project linked with OntoCompoFramework)
*
* Copyright (C) 2011 -  Christian Brel
*
* @author   Main    Christian Brel
**/
package applications.reversestring.ui.lib;

import javax.swing.JFrame;

import org.objectweb.fractal.fraclet.annotations.Component;
import org.objectweb.fractal.fraclet.annotations.Interface;
import org.objectweb.fractal.fraclet.annotations.Requires;

@Component(provides = {@Interface(name = "jFrameItf", signature = org.objectweb.fractal.swing.JFrameItf.class), @Interface(name = "jFrameAttributes", signature = org.objectweb.fractal.swing.JFrameAttributes.class), @Interface(name = "uijframeservice", signature = ontocompo.api.UIJFrameService.class), @Interface(name = "ontocompointrospection", signature = ontocompo.api.OntoCompoIntrospection.class)})
public class ReverseStringUI extends JFrame implements  org.objectweb.fractal.swing.JFrameItf, org.objectweb.fractal.swing.JFrameAttributes, ontocompo.api.UIJFrameService, ontocompo.api.OntoCompoIntrospection {

	private org.objectweb.fractal.api.Component c;
	private String applicationName;
	private String uid;
	
	@Requires(name = "mainpanel")
	private ontocompo.api.UIContainerService mainpanel;
	
	public ReverseStringUI() {
		super();
		this.applicationName = "ReverseString";
		this.uid = "applications.reversestring.ui.lib.ReverseStringUI";
		
		System.out.println(this.toString() + " created");
	}
	
	@Override
	public org.objectweb.fractal.api.Component getFractalComponent() {
		// TODO Auto-generated method stub
		return this.c;
	}

	@Override
	public void setFractalComponent(org.objectweb.fractal.api.Component c) {
		// TODO Auto-generated method stub
		this.c = c;
	}

	@Override
	public JFrame getJFrameItSelf() {
		// TODO Auto-generated method stub
		return this;
	}

	@Override
	public void init() {
		// TODO Auto-generated method stub
		this.mainpanel.init();
		
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		this.setContentPane(this.mainpanel.getComponentItSelf());
		
		this.pack();
		this.setVisible(true);
	}

	@Override
	public String getApplicationName() {
		// TODO Auto-generated method stub
		return this.applicationName;
	}

	@Override
	public String getUid() {
		// TODO Auto-generated method stub
		return this.uid;
	}

	@Override
	public void setWidth(int width) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void setHeight(int height) {
		// TODO Auto-generated method stub
		
	}
	
	public String toString() {
		return "ReverseStringUI";
	}
	
	@Override
	public void setUid(String uid) {
		// TODO Auto-generated method stub
		this.uid = uid;
	}

}
